package com.zeng.test;

import com.zeng.Util.Mybatis;
import com.zeng.mapper.UserMapper;
import com.zeng.pojo.User;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.List;

/**
 * @author zeng
 * @date 2021/08/04 19:57
 */
public class Demo {
    @Test
    public void getUser(){
        ApplicationContext context = new ClassPathXmlApplicationContext("mybatis-spring.xml");
        List<User> users = context.getBean("user", UserMapper.class).getUsers();
        for (User user : users) {
            System.out.println(user);
        }
    }
}
